# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import xadmin

from .models import Course, Lesson, Video, CourseResource

# Register your models here.


class CourseAdmin(object):
	list_display = ['name', 'desc', 'detail', 'degree', 'learn_time', 'students', 'fav_nums', 'image', 'click_nums', 'create_time']
	search_fields = ['name', 'desc', 'detail', 'degree', 'learn_time', 'students', 'fav_nums', 'image', 'click_nums']
	list_filter = ['name', 'desc', 'detail', 'degree', 'learn_time', 'students', 'fav_nums', 'image', 'click_nums', 'create_time']


class LessonAdmin(object):
	list_display = ['couser', 'name', 'ceate_time']
	search_fields = ['couser', 'name']
	list_filter = ['couser', 'name', 'ceate_time']


class VideoAdmin(object):
	list_display = ['lesson', 'name', 'create_time']
	search_fields = ['lesson', 'name']
	list_filter = ['lesson', 'name', 'create_time']


class CourseResourceAdmin(object):
	list_display = ['course', 'name', 'download', 'create_time']
	search_fields = ['course', 'name', 'download']
	list_filter = ['course', 'name', 'download', 'create_time']


xadmin.site.register(Course, CourseAdmin)
xadmin.site.register(Lesson, LessonAdmin)
xadmin.site.register(Video, VideoAdmin)
xadmin.site.register(CourseResource, CourseResourceAdmin)
